import { fromJS } from 'immutable'

export default {

  // 搜索
  setSearchData(state, action) {
    let data = fromJS(action.payload)
    let newState = state.set('searchStatus',false)
    // 追加数据
    return newState.updateIn(['searchs'], item => item.concat(data))
  },

  // 禁用
  disabledBtn(state,action){
    return state.set('searchStatus',true)
  },

  // 清空
  clearSearch(state,action){
    return state.removeAll('searchs')
  }

}